// 监听扩展程序进程或内容脚本发送的请求
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
    switch (request.action) {
        case "GetDuration":
            let res = calTime(request.p1, request.p2)
            sendResponse(res);
            break;
        default:
            console.log('content.js received message');
    }
});